package net.zoneland.zrdp.biz.common;

import net.zoneland.zrdp.biz.enums.TaskStatusEnums;

import static net.zoneland.zrdp.biz.enums.TaskStatusEnums.ASSIGNED;
import static net.zoneland.zrdp.biz.enums.TaskStatusEnums.READY;

/**
 * 系统常用量.
 */
public final class Constants {

    /**
     * 分隔符相关.
     **/
    public static final String SPLIT_COMMA                  = ",";   // 逗号
    public static final String SPLIT_SEMICOLON              = ";";   // 分号
    public static final String SPLIT_EQUAL                  = "=";   // 等于
    public static final String SPLIT_UNDERLINE              = "_";   // 下划线分
    public static final String SPLIT_AND_JOIN               = "&";   // 与
    public static final String SPLIT_DASH                   = "-";   // 横杠
    public static final String SPLIT_COLON                  = ":";   // 冒号
    public static final String SPLIT_SLASH                  = "/";   // 斜杠
    public static final String SPLIT_VERTICAL_LINE          = "|";   // 垂直线
    public static final String SPLIT_TILDE                  = "~";   // 波浪号
    public static final String SPLIT_QUESTION_MARK          = "?";   // 问号
    public static final String SPLIT_POINT_ESAPE            = "\\."; // 点
    public static final String SPLIT_VERTICAL_LINE_ESCAPE   = "\\|"; // 竖线
    public static final String SPLIT_SYMBOL                 = "@";   //@符


    /**
     * 系统批量数据操作阀值.
     **/
    public static final int PAGER_PAGE = 1;                      // 分页查询：当前页数
    public static final int PAGER_ROWS = 10;                     // 分页查询：每页数据量(thymeleaf分页)
    public static final int PAGER_LIMIT = 10;                    // 分页查询：每页数据量(layui分页)
    public static final int QUERY_DATA_LIMIT = 1000;             // 后台一次查询库表的记录数
    public static final int BATCH_INSERT_LIMIT = 5000;           // 每次批量插入限制数
    public static final int EXPORT_EXCEL_WIDTH = 25;             // 导出Excel列宽

    public static final String STRING_ZERO = "0";                 // 零
    public static final int NUMBER_ZERO = 0;                      // 0
    public static final int NUMBER_ONE  = 1;                      // 1
    public static final int NUMBER_TWO  = 2;                      // 2
    public static final int NUMBER_THREE = 3;                     // 3
    public static final int NUMBER_FOUR = 4;                      // 4
    public static final int NUMBER_FIVE = 5;                      // 5
    public static final int NUMBER_SIX = 6;                       // 6
    public static final int NUMBER_SENVEN = 7;                    // 7
    public static final int NUMBER_EIGHT = 8;                     // 8
    public static final int NUMBER_NINE = 9;                      // 9
    public static final int NUMBER_TEN = 10;                      // 10

    /**
     * 组织信息相关.
     **/
    public static final String ZMCC = "ZMCC";                   //域编码
    public static final String ZMCC_ORG_NAME = "浙江移动";       // 浙江移动组织顶级名称
    public static final String ZMCC_OU = "OU";                 // 浙江移动组织DN标识符
    public static final String INNER_PROVINCE_ONAME = "省公司"; // 省级组织名称
    public static final String ORG_TOPORG_OID = "00200000000000000000"; // 内部组织顶级组织id
    public static final String ORG_TOPORG_PARENTORGID = "00000000000000000000"; // 最顶级组织的父组织id
    public static final String ORG_TOPORG_DN = "O=zmcc"; // 内部组织顶级组织id
    public static final String INNER_PROVINCE_DN = "O=zmccxn"; // 省级虚拟组织名称
    public static final String INNER_PROVINCE_OID = "0020999900000000000000000000"; // 省公司（虚拟的）
    public static final String ALL_CITY_COMPANY_DN = "O=zmcccity"; // 各地市分公司节点编码
    public static final String ALL_CITY_COMPANY_NAME = "各地市分公司"; // 各地市分公司节点名称
    public static final String ALL_COUNTY_COMPANY_DN = "O=zmcccounty"; // 各县市分公司节点编码
    public static final String ALL_COUNTY_COMPANY_NAME = "各县市分公司"; // 各县市分公司节点名称

    /**
    * 流程相关.
    **/
    public static final int UNIFLOW_PARAMFLAG = 0x0001 | 0x0018 | 0x0060; //参数标记
    /** 流程模板版本号. **/
    public static final int UNIFLOW_PRIORITY_VER = 0;

    public static final String DRAFT_NODE_OPTION = "暂存";
    public static final String DRAFT_NAME = "拟稿";
    public static final String DRAFT_NODE = "draft";
    public static final String DRAFT_EDIT_NAME = "拟稿修改";
    public static final String DRAFT_EDIT_NODE = "draftEdit";
    public static final String EOF_NODEID = "_EOF";
    public static final String EOF_NODENAME = "结束";
    /** 开始节点. **/
    public static final String BOF_NODEID = "_BOF";

    /**
     * 菜单资源信息.
     **/
    public static final String RES_ROOT_PARENT = "-1";              // 资源菜单一级节点
    public static final String RES_ROOT_PARENT_NAME = "系统菜单资源"; // 资源菜单一级节点

    public static final String NORMAL_USER = "user"; //默认角色
    public static final String ROLE_ADMIN = "admin"; //系统维护员
    public static final String ROLE_ADMIN_NAME = "系统维护员"; //系统维护员

    //时间格式
    public static final String PATTERN_HMS_DAWN = " 00:00:00";
    public static final String PATTERN_HMS_VAL = " 23:59:59";

    /** 就绪与被指派状态 : {@value}. **/
    public static final int[] READY_ASSIGNED_STATES = new int[]{
        READY.getValue(), ASSIGNED.getValue()};

    /** 完成、终止以及单向指派状态 : {@value}. **/
    public static final int[] FINISH_STOP_SINGLE_ASSIGNMENT_STATES = new int[]{TaskStatusEnums.FINISH.getValue(),
        TaskStatusEnums.STOP.getValue(), TaskStatusEnums.SINGLE_ASSIGNMENT.getValue()};

    /** 草稿状态 : {@value}. **/
    public static final int[] DRAFT_STATES = new int[]{TaskStatusEnums.DRAFT.getValue()};

    /** 就绪、完成、草稿以及被指派状态 : {@value}. **/
    public static final int[] READY_FINISH_DRAFT_ASSIGNED_STATES = new int[]{READY.getValue(),
        TaskStatusEnums.FINISH.getValue(), TaskStatusEnums.DRAFT.getValue(), ASSIGNED.getValue()};
    /**
     * 默认构造方法.
     */
    private Constants() {
    }
}
